package com.xyy.saas.payment.enums;

/**
 * 状态1-待冻结 4-冻结中 8-冻结成功 16-冻结失败 32-解冻中 64-部分解冻成功 128-全部解冻成功 256-解冻失败
 */
public enum FrozenStatusEnum {
    FROZEN_WAIT(1, "待冻结"),
    FROZEN_ING(4, "冻结中"),
    FROZEN_SUCCESS(8, "冻结成功"),
    FROZEN_FAIL(16, "冻结失败"),
    UNFROZEN_INT(32, "解冻中"),
    SUB_UNFROZEN_SUCCESS(64, "部分解冻成功"),
    UNFROZEN_SUCCESS(128, "全部解冻成功"),
    UNFROZEN_FAIL(256, "解冻失败"),
    ;

    public static FrozenStatusEnum get(Integer status) {
        for(FrozenStatusEnum statusEnum : values()) {
            if(statusEnum.getStatus().equals(status)) {
                return statusEnum;
            }
        }

        throw new UnsupportedOperationException("FrozenSettlementStatusEnum, status=" + status);
    }

    FrozenStatusEnum(Integer status, String desc) {
        this.status = status;
        this.desc = desc;
    }

    private Integer status;
    private String desc;

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }
}